﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FuelAbp
{
    public class GuiTouApiResult<T> 
    {
        public int Code { get; set; }
        public string Message { get; set; }
        public T Data { get; set; }
        public int PageCount { get; set; }
        public int TotalCount { get; set; }
   

        public GuiTouApiResult(int code, string message, T data)
        {
            Code = code;
            Message = message;
            Data = data;
        }

        //public GuiTouApiResult(int code, string message, T data,int totalcount,int totalpage)
        //{
        //    Code = code;
        //    Message = message;
        //    Data = data;
        //    TotalCount = totalcount;
        //    PageCount = totalpage;
        //}

        public static GuiTouApiResult<T> Success(T data)
        {
            return new GuiTouApiResult<T>(200, "Success",data);
        }
        public static GuiTouApiResult<T> Error(string message)
        {
            return new GuiTouApiResult<T>(500, message,default!);
        }
    }
}
